import bsinRequest from '../utils/bsinRequest';

// 获取待办任务列表
export const getTasksByUser = (params: object) => {
  return bsinRequest('/getTasksByUser', {
    serviceName: 'BsinAdminProcessInstanceTaskService',
    methodName: 'getTasksByUser',
    bizParams: {
      ...params,
    },
  });
};

// 任务委派
export const delegateTask = (params: object) => {
  return bsinRequest('/delegateTask', {
    serviceName: 'BsinTaskService',
    methodName: 'delegateTask',
    bizParams: {
      ...params,
    },
  });
};

// 任务转办
export const transfer = (params: object) => {
  return bsinRequest('/transfer', {
    serviceName: 'BsinTaskService',
    methodName: 'transfer',
    bizParams: {
      ...params,
    },
  });
};

// 任务解决
export const resolveTask = (params: object) => {
  return bsinRequest('/resolve', {
    serviceName: 'BsinTaskService',
    methodName: 'resolve',
    bizParams: {
      ...params,
    },
  });
};

// 任务完成
export const complete = (params: object) => {
  return bsinRequest('/complete', {
    serviceName: 'BsinTaskService',
    methodName: 'complete',
    bizParams: {
      ...params,
    },
  });
};

// 获取所有节点
export const getAllNode = (params: object) => {
  return bsinRequest('/getAllNode', {
    serviceName: 'BsinTaskService',
    methodName: 'getAllNode',
    bizParams: {
      ...params,
    },
  });
};

// 获取意见信息
export const getActInstList = (params: object) => {
  return bsinRequest('/getActInstList', {
    serviceName: 'BsinAdminProcessInstanceService',
    methodName: 'getActInstList',
    bizParams: {
      ...params,
    },
  });
};

// 驳回
export const flowTackback = (params: object) => {
  return bsinRequest('/flowTackback', {
    serviceName: 'BsinTaskService',
    methodName: 'flowTackback',
    bizParams: {
      ...params,
    },
  });
};

// 获取申请表单
export const getStartFormData = (params: object) => {
  return bsinRequest('/getStartFormData', {
    serviceName: 'BsinFormRepositoryService',
    methodName: 'getStartFormData',
    bizParams: {
      ...params,
    },
  });
};
